package com.sam.demo.config;

import com.alibaba.druid.pool.DruidDataSource;

import javax.sql.DataSource;

public class JpaDataSourceConfigCommon {
    public final static String PRIMARY_DATASOURCE_KEY = "primaryDataSource";
    public final static String SECONDAYR_DATASOURCE_KEY = "secondaryDataSource";

    private String url;
    private String username;
    private String password;

    public DataSource dataSource() {
        DruidDataSource mysqlXaDataSource = new DruidDataSource();
        mysqlXaDataSource.setUrl(url);
        mysqlXaDataSource.setUsername(username);
        mysqlXaDataSource.setPassword(password);
        return mysqlXaDataSource;
    }


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
